package com.lyz.dataStructure.algorithm.道通科技2020;/**
 * @Author:759057893@qq.com Lyz
 * @Date: ${Date} 23:13
 * @Description:
 **/

import java.util.Scanner;
import java.util.regex.Pattern;

/**
 *@Author:759057893@qq.com Lyz
 *@Date: 2019/9/16 23:13
 *@Description:
 **/
public class 替换固定字符串 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s =sc.nextLine();
        System.out.println(returnStr(s));
    }

    public static  String returnStr(String s){
        if(s.length()==0||s==null) return null;

        StringBuffer sb = new StringBuffer();
        int i =0;
        for (;i<s.length();i++){
            if(!s.matches("^[0-9]*$")){
                if(s.charAt(i)!='Q'){
                    sb.append(s.charAt(i));
                }
            }
            //abcQ123hkjQ24kdafQ35adfjk

            if(s.charAt(i)=='Q'){
               sb.append("Text");
            }
            if(s.charAt(i)>='0'&&s.charAt(i)<='9'){
                sb.append(0);
            }
        }
       return sb.toString();
    }
}
